import { validMobile, checkIDCard } from '../utils/validate';
export const GENDER = [
  {
    value: 'FEMALE',
    label: '女',
  },
  {
    value: 'MALE',
    label: '男',
  },
];
export const EDUCATION = [
  {
    value: 'BACHELOR',
    label: '本科',
  },
  {
    value: 'VOCATIONAL',
    label: '大专',
  },
  {
    value: 'HIGHSCHOOL',
    label: '高中',
  },
  {
    value: 'PRIMARY',
    label: '初中及以下',
  },
  {
    value: 'OTHER',
    label: '其他',
  },
];
// 工人表单校验规则
export const FORM_RULES = {
  name: [
    { required: true, message: '请输入姓名' },
    { min: 2, max: 30, message: '长度在 2 到 30 个字符' },
  ],
  mobile: [
    { required: true, message: '请输入手机号' },
    { validator: validMobile, message: '请输入正确的手机号' },
  ],
  gender: [{ required: true, message: '请选择性别' }],
  // Age: [
  //   { type: 'number', message: '年龄必须为数字值' },
  // ],
  idcardNo: [
    // { required: true, message: '请输入身份证号码' },
    {
      validator: checkIDCard,
      message: '请输入正确的身份证号码',
    },
  ],
};
const SMALL_COLUMN = 50;
export const NARROW_COLUMN = 120;
export const MEDIUM_COLUMN = 150;
export const BIG_COLUMN = 300;
export const COLOMN_SETTINGS = [
  {
    key: 'name',
    label: '姓名',
    width: NARROW_COLUMN,
    showTips: true,
    fixed: true,
  },
  {
    key: 'mobile',
    label: '手机号',
    width: NARROW_COLUMN,
  },
  {
    key: 'gender',
    label: '性别',
    width: SMALL_COLUMN,
    showTips: true,
  },
  {
    key: 'age',
    label: '年龄',
    width: SMALL_COLUMN,
  },
  // 身份证号
  {
    key: 'idcardNo',
    label: '身份证号',
    width: 180,
  },
  {
    key: 'education',
    label: '学历',
    width: NARROW_COLUMN,
  },
  {
    key: 'birthPlace',
    label: '户籍',
    width: NARROW_COLUMN,
  },
  {
    key: 'tenantName',
    label: '用工单位',
    // width: NARROW_COLUMN,
  },
  {
    key: 'sendTime',
    label: '派遣时间',
    width: BIG_COLUMN,
    datatype: 'time',
  },
  {
    key: 'sendStartTime',
    label: '派遣开始时间',
    width: NARROW_COLUMN,
    datatype: 'time',
  },
  {
    key: 'sendEndTime',
    label: '派遣结束时间',
    width: NARROW_COLUMN,
    datatype: 'time',
  },
  {
    key: 'address',
    label: '现住址',
    showTips: true,
  },
  {
    key: 'createdOn',
    label: '录入时间',
    width: MEDIUM_COLUMN,
    showTips: true,
    datatype: 'time',
    format: 'YYYY-MM-DD HH:mm',
  },
  {
    key: 'contractName',
    label: '合同名称',
    // width: MEDIUM_COLUMN,
    showTips: true,
  },
  {
    key: 'deadline',
    label: '签署截止时间',
    width: MEDIUM_COLUMN,
    datatype: 'time',
    format: 'YYYY-MM-DD HH:mm',
  },
  {
    key: 'deletedOn',
    label: '离职日期',
    width: MEDIUM_COLUMN,
    datatype: 'time',
    format: 'YYYY-MM-DD',
  },
];
export const WORKER_STATUS = {
  ALL: '待派遣',
  SEND: '已派遣',
  INIT: '待签署',
  QUIT_JOB: '已离职',
};
